/**
 * Created by win 10 on 2/27/2018.
 */
function GetQueryString(name){
    var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
    var r = window.location.search.substr(1).match(reg);
    if(r!=null)return  unescape(r[2]); return null;
}
$(function () {
    var id = GetQueryString("id");
    $.ajax({
        url: '/sichuansfc/fund/manager/fund/detail.bs?id='+id,
        type: 'get',
        headers: {'FUND_USER_TOKEN': $.cookie('FUND_USER_TOKEN')},
        success: function (data) {
            if (data.status === 100000) {
                data = data.data
                for (var key in data) {
                    if (key == 'endTime' || key == 'fundTime' || key == 'putOnTime') {
                        data[key] =data[key] ?  parseCastingDate(data[key].toString(), 'yyyy-MM-dd') : "";
                        $("[name="+key+"]").val(data[key]);
                    }
                    $("[name="+key+"]").val(data[key]);
                }
                $(".count").text(data.updateCount);
            }
        },
        error: function () {
            alert("服务器错误");
        }
    })

})